/**
 * 
 */
package stationGUI;

import java.awt.Color;
import java.io.ObjectOutputStream;

/**
 * @author Owner
 *
 */
public class ClientNode {
  /**
   * 
   */
  
  NeighborhoodScreen neighborhood;
  ProgressPanel progress;
  ObjectOutputStream out;
  NodeBean me;
  
  public ClientNode(NodeBean n,ObjectOutputStream o) {
    me=n;
    out=o;
    new Station(this);
  }
  
  public void sendColor(Color c) throws Exception {
    out.writeObject(c);
  }
  
  public void update(NodeBean2 n) {
    NodeBean current;
    for(int i=0;i<me.neighbors.size();i++) {
      current=me.neighbors.get(i);
      current.color=n.neighbors.get(i);
    }
    progress.updateSlider(n.progress);
    neighborhood.repaint();//update();
  }
  
  
  
  public void repaintNeighborhood() {
    //this.neighborhoodScreen.repaint();
    //serverOut.writeObject(this);
  }
}